import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

public class HelloAc extends ActionSupport {
    private String username;
    private String password;
    private int[] listfor= new int[]{1, 2, 3};

    public int[] getListfor() {
        return listfor;
    }

    public void setListfor(int[] listfor) {
        this.listfor = listfor;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }




    public String hell0() {
        if (username == "123") {
            return "success";
        }
        HttpServletRequest request = ServletActionContext.getRequest();
        request.setAttribute("um",this.username);
        request.setAttribute("pw",this.password);
        HttpSession session=request.getSession();
        session.setAttribute("umm",this.username);

        List list=new ArrayList();
        list.add("5");
        list.add("4");
        list.add("3");
        list.add("2");
        list.add("1");
        request.setAttribute("aa",list);

        return "success";
    }


}
